<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="crm.model.Product_service"%>
<%@page import="crm.control.ProductControl"%>
<%@page import="crm.util.ParamUtil"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>product_service_update_do.jsp</title>
    

  </head>
  
  <body>
      <%
        request.setCharacterEncoding("UTF-8");
        Product_service productService=new Product_service();
        
        int id=Integer.parseInt(request.getParameter("id"));
        productService=ProductControl.getProductServiceById(id);
        
        String service_name=ParamUtil.getString(request,"product_service_name");
        productService.setService_name(service_name);
        
        String service_number=ParamUtil.getString(request,"product_service_number");
        productService.setService_number(service_number);
        
        String service_price=ParamUtil.getString(request,"product_service_price");
        productService.setPrice(service_price);
        
        String service_description=ParamUtil.getString(request,"product_service_description");
        productService.setDescription(service_description);
        
        //String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
        String create_time=ParamUtil.getString(request,"product_service_create_time");
        productService.setCreate_time(create_time);
        
      		if (ProductControl.updateProductService(id)){
		%>
		<script type="text/javascript">
if (window.confirm("修改成功！"))
	window.location.href = "product_service.jsp";
	else
    window.location.href = "product_service.jsp";
</script>
		<%
			} else {
		%>
		<script type="text/javascript">
if (window.confirm("修改失败！"))
	window.location.href = "product_service.jsp";
	else
    window.location.href = "product_service.jsp";
</script>
		<%
			}
			%>
  </body>
</html>
